<!DOCTYPE html>
<html style="display: flex;flex-direction: column;align-items: center;">

<head>
    <title>LanGenius - Transfer file easily</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width initial-scale=1.0 user-scalable=no">
    <script type="text/javascript">
    function setCookie(cname, cvalue, exdays) {
        var d = new Date();
        d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
        var expires = "expires=" + d.toGMTString();
        document.cookie = cname + "=" + cvalue + "; " + expires;
    }

    function getCookie(cname) {
        var name = cname + "=";
        var ca = document.cookie.split(';');
        for (var i = 0; i < ca.length; i++) {
            var c = ca[i].trim();
            if (c.indexOf(name) == 0) return c.substring(name.length, c.length);
        }
        return "";
    }

    function check_os() {
        if (navigator.userAgent.indexOf("Windows") != -1) {
            return "windows"
        }
        if (navigator.userAgent.indexOf("Android") != -1) {
            return "android"
        }
        return "linux"
    }

    function DoDownload() {
        var sl = document.getElementById("sl_os")
        if (sl.value == "windows") {
            window.open('res/langenius-windows-setup.exe')
            var blk = document.getElementById('tag_windows')
            blk.style.backgroundColor = '#fff'
            blk.style.boxShadow = '2px 2px 2px #000'
            var bd = document.getElementsByTagName('body')[0]
            bd.style.backgroundColor = '#aaa'
        } else if (sl.value == 'linux') {
            window.open('res/langenius-linux-amd64.tar.bz2')
            var blk = document.getElementById('tag_linux')
            blk.style.backgroundColor = '#fff'
            blk.style.boxShadow = '2px 2px 2px #000'
            var bd = document.getElementsByTagName('body')[0]
            bd.style.backgroundColor = '#aaa'
        } else if (sl.value == 'android') {
            window.open('res/langenius-android.apk')
            var blk = document.getElementById('tag_android')
            blk.style.backgroundColor = '#fff'
            blk.style.boxShadow = '2px 2px 2px #000'
            var bd = document.getElementsByTagName('body')[0]
            bd.style.backgroundColor = '#aaa'
        }else if(sl.value=='mac'){
            window.open('res/langenius-mac.zip')
            var blk = document.getElementById('tag_mac')
            blk.style.backgroundColor = '#fff'
            blk.style.boxShadow = '2px 2px 2px #000'
            var bd = document.getElementsByTagName('body')[0]
            bd.style.backgroundColor = '#aaa'
        }
        location.href = '#tag_' + sl.value
    }
    </script>
    <style type="text/css">
    a {
        cursor: pointer;
    }

    .command {
        padding: 5px;
        background-color: #bbb;
        border-radius: 3px;
        color: green;
        margin: 0px;
    }

    .nobr {
        margin: 0px;
        padding: 0px;
    }

    #tag_windows,
    #tag_linux,
    #tag_android {
        padding: 5px;
        border-radius: 5px;
    }
    </style>
</head>

<body style="display: flex;flex-direction: column;align-items: stretch;font-family: sans-serif;max-width: 700px;width: 100%;">
    <h1 style="color: #444">LanGenius <a href="index.html" onclick="setCookie('lang','zh-CN',365)" style="font-size: 18px;">中文</a></h1>
    <a href="donate.html">Donate</a>
    <h4 style="color: #444">Transfer file on LAN (Local Area Network) easily</h4>
        <h4 style="color: green">Note:v5.1.1 for Android released ! 20181213</h4>
    <div style="align-items: center;display: flex;flex-direction: column;">
        <img src="res/share.jpg" style="max-width: 200px;box-shadow: 2px 2px 2px #aaa">
        <br>
        <br>
        <div style="background-color: #666;display: flex;flex-direction: row;max-width: 200px;width: 100%;align-items: stretch;border-radius: 5px;">
            <a id="bt_main_download" onclick="DoDownload()" style="color: #fff;flex-grow: 1;padding: 10px;">Download</a>
            <select style="flex-grow: 1;margin: 3px;" id="sl_os">
                <option value="windows">Windows</option>
                <option value="linux">Linux</option>
                <option value="android">Android</option>
                <option value="mac">Mac</option>
            </select>
        </div>
    </div>
    <p></p>
    <p></p>
    <p></p>
    <p></p>
    <div id="tag_windows">
        <h1>Windows: After Downloading</h1>
        <h4>1.Double click that .exe file to install it</h4>
    </div>
    <p></p>
    <p></p>
    <p></p>
    <p></p>
    <div id="tag_linux">
        <h1>Linux:After Downloading</h1>
        <h4 class="nobr">1.Uncompress it:</h4>
        <h4 class="command">sudo tar xvf langenius-linux-amd64.tar.bz2 -C /opt</h4>
        <h4 class="nobr">2.Install it</h4>
        <h4 class="command">cd /opt/langenius</h4>
        <h4 class="command">sudo ./install.sh</h4>
        <h4 class="nobr">3.Make it executable anywhere</h4>
        <h4 class="command">sudo ln -s /opt/langenius/langenius /usr/bin</h4>
        <h4 class="nobr">4.Now you can share your file on LAN !</h4>
        <h4 class="command">langenius ./a.txt</h4>
    </div>
    <p></p>
    <p></p>
    <p></p>
    <p></p>
    <p></p>
    <div id="tag_android">
        <h1>Android: After Downloading</h1>
        <h4 class="nobr">1.Open .apk file to install it</h4>
    </div>
    <p></p>
    <p></p>
    <p></p>
    <p></p>
    <p></p>
        <div id="tag_mac">
        <h1>Mac: After Downloading</h1>
        <h4 class="nobr">1.Unzip it , execute 'langenius' file</h4>
    </div>
    <p></p>
    <p></p>
    <p></p>
    <p></p>
    <p></p>
    <script>
        location.href='https://www.lan-genius.com'
    </script>
</body>

</html>